#include "Catalogs.h"

#include <QtGui/QLabel>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>

#include "IV22.h"
#include "BSC.h"
#include "KStars.h"

#include "ui_StarCatalog.h"

Catalogs::Catalogs()
{
    //QLabel* l = new QLabel( this );
    //l->setText( "Hello World!" );
    //setCentralWidget( l );
    QAction* a = new QAction(this);
    a->setText( "Quit" );
    connect(a, SIGNAL(triggered()), SLOT(close()) );
    menuBar()->addMenu( "File" )->addAction( a );
    //cat=new Iv22();
    //cat->setDatafileName("/nfs/devel/indi-tools-import/Catalogs/catalogs/IV22/index.dat");
    //cat=new Bsc();
    //cat->setDatafileName("/nfs/devel/indi-tools-import/Catalogs/catalogs/bsc/bsc5.dat");  
    cat=new KStars();
    cat->setDatafileName("/usr/share/kde4/apps/kstars/stars.dat");    
    cat->loadData();
    QWidget *stiv22 = new QWidget(this);
    Ui::StarCatalog *ui_stiv22 = new Ui::StarCatalog();
    ui_stiv22->setupUi(stiv22);
    ui_stiv22->tableViewStars->setModel(cat);
    printf("Got %d stars\n", cat->rowCount(QModelIndex()));
    ui_stiv22->tableViewStars->resizeColumnsToContents();
    ui_stiv22->tableViewStars->resizeRowsToContents();
    setCentralWidget(stiv22);
    this->resize(stiv22->size());
}

Catalogs::~Catalogs()
{}

